package tech.eyao.hs60x.property.editor;

import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;

public class CustomDateWebBindingInitializer extends WebMvcConfigurerAdapter implements WebBindingInitializer {
	@Autowired
    private RequestMappingHandlerAdapter handlerAdapter;

	@Override
    public void initBinder(WebDataBinder binder, WebRequest request) {
        binder.registerCustomEditor(Date.class, new tech.eyao.hs60x.property.editor.CustomDateEditor());
    }
}
